package demo.partten.filterPattern.pattern.impl;

import demo.partten.filterPattern.pattern.Person;
import demo.partten.filterPattern.pattern.Criteria;

import java.util.List;
import java.util.stream.Collectors;

public class CriteriaMale implements Criteria {
    @Override
    public List<Person> meetCriteria(List<Person> persons) {
        return persons.stream().filter(e -> e.getGender() == 1).collect(Collectors.toList());
    }
}
